package com.cc.service.impl;

import com.cc.dao.AttendanceDao;
import com.cc.dao.impl.AttendanceDaoImpl;
import com.cc.service.AttendanceService;
import org.apache.log4j.Logger;

/**
 * @author CC
 * @version 1.0
 * @description: 考勤服务实现类
 * @date 2025/3/31 9:36
 */
public class AttendanceServiceImpl implements AttendanceService {
   private static final Logger logger = Logger.getLogger(AttendanceServiceImpl.class);
    AttendanceDao attendanceDao = new AttendanceDaoImpl();
    @Override
    public void clockIn(String employeeId) {
        //判断是否已经打卡
        boolean flag = attendanceDao.isClockIn(employeeId);
        if (flag){
            logger.debug("已经打卡");
            attendanceDao.updateClockIn(employeeId);
        }else {
            logger.debug("打卡成功");
            attendanceDao.clockIn(employeeId);
        }

    }
}
